/*
 * DBPool.h
 *
 *  Created on: Aug 12, 2016
 *      Author: ubuntu
 */

#ifndef DBPOOL_H_
#define DBPOOL_H_

#include <mysql++/mysql++.h>
#include <iostream>

using namespace std;
using namespace mysqlpp;

class DBPool : public ConnectionPool {
public:
	DBPool(const char *dbname, const char *host, const char *user, const char *pass, int port = 0);
	virtual ~DBPool();

protected:
	virtual Connection* create();
	virtual void destroy(Connection *);
	virtual unsigned int max_idle_time();

	string m_db, m_host, m_user, m_pass;
	int m_port;

};



#endif /* DBPOOL_H_ */
